<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 * SİTE CONFIG MODEL
 *
 * @author Ali OYGUR <alioygur@gmail.com>
 * */
class Setting_model extends MY_Model
{
	public function __construct()
	{
		parent::__construct();
	}

	public function add($data = array())
	{
		$this->db->insert('setting', $data);
	}

	public function get_all($select = '*')
	{
		$q = $this->db->select($select)->order_by('group')->get('setting');

		return (!$q->num_rows()) ? FALSE : $q->result();
	}

	public function edit($data)
	{
		foreach ($data as $key => $value)
		{
			foreach ($value as $key2 => $value2)
			{
				$this->db->update('setting', array('value' => $value2), array('group' => $key, 'key' => $key2));
			}
		}
	}
}

/* End of file setting_model.php */
